@extends('layouts.console_header')

@section('title', '地推设置')

@section('resources')
    @parent
	<style>
		.user_salesman_edit{float: right;background-color: #9955c6;color: #fff;padding: 5px 10px;border-radius: 5px;}
        .shop_common_salesman_edit,.shop_partner_salesman_edit{float: right;color: #9955c6;cursor: pointer;}
		.details1{background-color: #fff;border-radius: 5px;padding: 1px 15px;}
		.user_list .details1 .salesman_history{border: none;}
		.salesman_history a{color: #9955c6;}
        .shop_common_setup_details{font-size: 14px;padding: 0 15px;}
		.shop_partner_setup_details{font-size: 14px;padding: 0 15px;}
		.shop_common_setup_details li{border-bottom: 1px solid #eee;padding: 20px 0;overflow: hidden;}
		.shop_common_setup_details li .contant{float: left;width: 680px;}
		.shop_common_setup_details li .front{width: 115px;float: left;margin-right: 15px;}
		.shop_partner_setup_details li{border-bottom: 1px solid #eee;padding: 20px 0;overflow: hidden;}
        .shop_partner_setup_details li .contant{float: left;width: 680px;}
        .shop_partner_setup_details li .front{width: 115px;float: left;margin-right: 15px;}
		#shop_common_setup .setup_outer{font-size: 14px;padding: 0 15px;}
		#shop_common_setup .setup_outer .setup_outerli{border-bottom: 1px solid #eee;overflow: hidden;}
		#shop_common_setup .setup_outer .setup_outerli .front{width: 115px;float: left;margin-right: 15px;margin-top: 20px;}
		#shop_common_setup .setup_outer .setup_outerli ul{float: left;width: 1000px;}
		#shop_common_setup .setup_outer .setup_outerli ul li{margin: 20px 0;}
		#shop_common_setup .setup_outer .setup_outerli ul input[type='text']{width: 50px;height: 20px;border: 1px solid #000;border-radius: 5px;text-align: center;}
		#shop_common_setup .button{margin: 20px 140px;overflow: hidden;}
		#shop_common_setup .button input[type='button']{float: left;width: 100px;height: 30px;font-size: 18px;margin: 0 20px;border-radius: 5px;cursor: pointer;}
		#shop_common_setup .button .shop_common_setup_preserve{background-color: #9955c6;color: #fff;}
		#shop_common_setup .button .shop_common_setup_cancel{background-color: #fff;color: #808080;border: 1px solid #808080;}
		#shop_partner_setup .setup_outer{font-size: 14px;padding: 0 15px;}
        #shop_partner_setup .setup_outer .setup_outerli{border-bottom: 1px solid #eee;overflow: hidden;}
        #shop_partner_setup .setup_outer .setup_outerli .front{width: 115px;float: left;margin-right: 15px;margin-top: 20px;}
        #shop_partner_setup .setup_outer .setup_outerli ul{float: left;width: 1000px;}
        #shop_partner_setup .setup_outer .setup_outerli ul li{margin: 20px 0;}
        #shop_partner_setup .setup_outer .setup_outerli ul input[type='text']{width: 50px;height: 20px;border: 1px solid #000;border-radius: 5px;text-align: center;}
        #shop_partner_setup .button{margin: 20px 140px;overflow: hidden;}
        #shop_partner_setup .button input[type='button']{float: left;width: 100px;height: 30px;font-size: 18px;margin: 0 20px;border-radius: 5px;cursor: pointer;}
        #shop_partner_setup .button .shop_partner_setup_preserve{background-color: #9955c6;color: #fff;}
        #shop_partner_setup .button .shop_partner_setup_cancel{background-color: #fff;color: #808080;border: 1px solid #808080;}
        .setup_name_input{width: 600px;height: 20px;padding: 5px;float: left;border: 1px solid #666;margin: 10px 0;}
        .display{text-align: center;background-color: #fff;border-collapse:collapse;}
        .display th{padding: 20px 0;}
        .display #tbody_content{border-top: 1px solid #000;border-bottom: 1px solid #000;font-size: 14px;}
        .display #tbody_content tr:nth-child(2n+1){border-bottom: 1px solid #ddd;background-color: #f9f9f9;}
        .display #tbody_content tr:nth-child(2n){border-bottom: 1px solid #ddd;}
        .display #tbody_content tr td{padding: 10px 0;}
        .display #tbody_content tr td:nth-child(1){background-color: #f1f1f1;}
	</style>
@endsection

@section('content')
<section class="user_list">
	<div style="border-bottom: 2px solid #9955c6;overflow: hidden;">
		<p class="fz_14 account_title fl" style="border: none;">
		    <span style="color: #7f7f7f;"><a href="/console/index">首页</a>>地推管理></span>
		    <span class="co_violet">地推设置</span>
        </p>
	</div>
	<!-- 个人地推 -->
    <div class="details1" style="margin-top: 20px;">
        <p style="overflow: hidden;margin: 10px 0;">
            <span style="float: left;">个人地推设置</span>
            <a href="/console/salesmanset/user/new?cityid={{$cityid}}" class="user_salesman_edit">新增个人地推方案</a>
        </p>
        <table class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>更新时间</th>
                    <th>方案名称</th>
                    <th>结算周期</th>
                    <th>有效地推定义</th>
                    <th>个人地推结算</th>
                    <th>地推人员</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody id="tbody_content">
            @foreach($usersalesmanlist as $list)
                <tr>
                @if(!isset($i))
                    <td>{{$i=1}}</td>
                @else
                    <td>{{++$i}}</td>
                @endif
                    <td>{{$list['created_at']}}</td>
                    <td>{{$list['name']}}</td>
                    <td>{{$list['accountperioddescription']}}</td>
                    <td>{{$list['showvalidsalesman']}}</td>
                    <td>{{$list['showaccountmethod']}}</td>
                    <td>{{$list['usercount']}}</td>
                    <td>
                        <a style="color: #9955c6;" href="/console/salesmanset/user/details?cityid={{$cityid}}&salesmansetid={{$list['id']}}">详情</a>
                    </td>
                </tr>
            @endforeach
            </tbody>
        </table>
	</div>

	<!-- 商家普通地推-->
    <div class="details1" hidden="hidden">
        <p style="overflow: hidden;margin: 10px 0;">
            <span style="float: left;">商家普通地推设置</span>
            <span class="shop_common_salesman_edit">编辑</span>
        </p>
        @if(!empty($shopcommonsalesman))
    		<ul class="shop_common_setup_details">
    			<li>
    				<span class="front">结算周期：</span>
    				<span class="contant">每{{$shopcommonsalesman['accountperiod']}}个月结算</span>
    			</li>
    			<li>
    				<span class="front">有效地推定义：</span>
    				<span class="contant">{{$shopcommonsalesman['showvalidsalesman']}}</span>
    			</li>
    			<li>
    				<span class="front">普通地推结算：</span>
    				<span class="contant">{{$shopcommonsalesman['showaccountmethod']}}</span>
    			</li>
    			<li class="salesman_history">
    				<a href="/console/salesman/setup/history?cityid={{$cityid}}">历史设置记录>></a>
    			</li>
    		</ul>
    		<form action="" method="" id="shop_common_setup" hidden>
    			<ul class="setup_outer">
    			    <input type="hidden" name="cityid" value="{{$cityid}}" />
                    <input type="hidden" name="salesmantype" value="shopsalesman">
                    <input type="hidden" name="shoptype" value="common">
    				<li class="setup_outerli">
    					<span class="front">结算周期：</span>
    					<ul>
    						<li>
    							<input type="radio" name="" value="" checked>
    							<span>每</span>
    							<input type="text" name="accountperiod" value="{{$shopcommonsalesman['accountperiod']}}">
    							<span>个月结算</span>
    						</li>
    					</ul>
    				</li>
    				<li class="setup_outerli">
    					<span class="front">有效地推定义：</span>
    					<ul>
    						<li>
    						@if($shopcommonsalesman['validsalesmanruletype'] == 1)
    							<input type="radio" name="validsalesmanruletype" value="1" checked>
                            @else
                                <input type="radio" name="validsalesmanruletype" value="1">
                            @endif
    							<span>与商家同城的新用户下载翻贝网App，首次登录时扫描二维码，获取邀请码完成登录即可。首次登录时未获取邀请码，可在2小时内用扫一扫功能扫二维码进入买单页面即可。</span>
    						</li>
    						<li hidden>
    							@if($shopcommonsalesman['validsalesmanruletype'] == 2)
                                    <input type="radio" name="validsalesmanruletype" value="2" checked>
                                    <span>新用户登录app且消费</span>
                                    <input type="text" name="validorderminnum" value="{{$shopcommonsalesman['validorderminnum']}}">
                                    <span>笔，单笔消费金额需达</span>
                                    <input type="text" name="validorderminamount" value="{{$shopcommonsalesman['validorderminamount']}}">
                                    <span>以上</span>
                                @else
                                    <input type="radio" name="validsalesmanruletype" value="2">
                                    <span>新用户登录app且消费</span>
                                    <input type="text" name="validorderminnum" value="0">
                                    <span>笔，单笔消费金额需达</span>
                                    <input type="text" name="validorderminamount" value="0">
                                    <span>以上</span>
                                @endif

    						</li>
    					</ul>
    				</li>
    				<li class="setup_outerli">
    					<span class="front">普通地推结算：</span>
    					<ul>
    						<li>
    						@if($shopcommonsalesman['accounttype'] == 1)
    							<input type="radio" name="accounttype" value="1" checked>
    							<span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney1" value="{{$shopcommonsalesman['registergetmoney']}}">
                                <span>元</span>
                            @else
                                <input type="radio" name="accounttype" value="1">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney1" value="0">
                                <span>元</span>
                            @endif
    						</li>
    						<li>
    							@if($shopcommonsalesman['accounttype'] == 2)
                                    <input type="radio" name="accounttype" value="2" checked>
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney2" value="{{$shopcommonsalesman['registergetmoney']}}">
                                    <span>元，且该用户的每笔消费实付金额满</span>
                                    <input type="text" name="accountorderminamount" value="{{$shopcommonsalesman['accountorderminamount']}}">
                                    <span>以上的订单按</span>
                                    <input type="text" name="ordergetmoney" value="{{$shopcommonsalesman['ordergetmoney']}}">
                                    <span>元／单计为地推订单收入</span>
                                @else
                                    <input type="radio" name="accounttype" value="2">
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney2" value="0">
                                    <span>元，且该用户的每笔消费实付金额满</span>
                                    <input type="text" name="accountorderminamount" value="0">
                                    <span>以上的订单按</span>
                                    <input type="text" name="ordergetmoney" value="0">
                                    <span>元／单计为地推订单收入</span>
                                @endif
    						</li>
    						<li>
    							@if($shopcommonsalesman['accounttype'] == 3)
                                    <input type="radio" name="accounttype" value="3" checked>
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney3" value="{{$shopcommonsalesman['registergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="ordergetratio" value="{{$shopcommonsalesman['ordergetratio']}}">
                                    <span>%计为地推订单收入。</span>
                                @else
                                    <input type="radio" name="accounttype" value="3">
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney3" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="ordergetratio" value="0">
                                    <span>%计为地推订单收入。</span>
                                @endif

    						</li>
    						<li>
    							@if($shopcommonsalesman['accounttype'] == 4)
                                    <input type="radio" name="accounttype" value="4" checked>
                                    <span>前</span>
                                    <input type="text" name="topnum" value="{{$shopcommonsalesman['topnum']}}">
                                    <span>名有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="topregistergetmoney" value="{{$shopcommonsalesman['topregistergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="topordergetratio" value="{{$shopcommonsalesman['topordergetratio']}}">
                                    <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="afterregistergetmoney" value="{{$shopcommonsalesman['afterregistergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="afterordergetratio" value="{{$shopcommonsalesman['afterordergetratio']}}">
                                    <span>%计为地推订单收入。</span>
                                @else
                                    <input type="radio" name="accounttype" value="4">
                                    <span>前</span>
                                    <input type="text" name="topnum" value="0">
                                    <span>名有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="topregistergetmoney" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="topordergetratio" value="0">
                                    <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="afterregistergetmoney" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="afterordergetratio" value="0">
                                    <span>%计为地推订单收入。</span>
                                @endif

    						</li>
    					</ul>
    				</li>
    			</ul>
    			<div class="button">
    				<input class="shop_common_setup_preserve" type="button" name="shop_common_setup_preserve" value="保存">
    				<input class="shop_common_setup_cancel" type="button" name="shop_common_setup_cancel" value="取消">
    			</div>
    		</form>
        @else
            <form action="" method="" id="shop_common_setup" hidden>
                <ul class="setup_outer">
                    <input type="hidden" name="cityid" value="{{$cityid}}" />
                    <input type="hidden" name="salesmantype" value="shopsalesman">
                    <input type="hidden" name="shoptype" value="common">
                    <li class="setup_outerli">
                        <span class="front">结算周期：</span>
                        <ul>
                            <li>
                                <input type="radio" name="" value="" checked>
                                <span>每</span>
                                <input type="text" name="accountperiod" value="0">
                                <span>个月结算</span>
                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <span class="front">有效地推定义：</span>
                        <ul>
                            <li>
                                <input type="radio" name="validsalesmanruletype" value="1">
                                <span>与商家同城的新用户下载翻贝网App，首次登录时扫描二维码，获取邀请码完成登录即可。首次登录时未获取邀请码，可在2小时内用扫一扫功能扫二维码进入买单页面即可。</span>
                            </li>
                            <li hidden>
                                <input type="radio" name="validsalesmanruletype" value="2">
                                <span>新用户登录app且消费</span>
                                <input type="text" name="validorderminnum" value="0">
                                <span>笔，单笔消费金额需达</span>
                                <input type="text" name="validorderminamount" value="0">
                                <span>以上</span>
                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <span class="front">普通地推结算：</span>
                        <ul>
                            <li>
                                <input type="radio" name="accounttype" value="1">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney1" value="0">
                                <span>元</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="2">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney2" value="0">
                                <span>元，且该用户的每笔消费实付金额满</span>
                                <input type="text" name="accountorderminamount" value="0">
                                <span>以上的订单按</span>
                                <input type="text" name="ordergetmoney" value="0">
                                <span>元／单计为地推订单收入</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="3">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney3" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="ordergetratio" value="0">
                                <span>%计为地推订单收入。</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="4">
                                <span>前</span>
                                <input type="text" name="topnum" value="0">
                                <span>名有效地推用户：每个有效地推的注册用户</span>
                                <input type="text" name="topregistergetmoney" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="topordergetratio" value="0">
                                <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                <input type="text" name="afterregistergetmoney" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="afterordergetratio" value="0">
                                <span>%计为地推订单收入。</span>
                            </li>
                        </ul>
                    </li>
                </ul>
                <div class="button">
                    <input class="shop_common_setup_preserve" type="button" name="shop_common_setup_preserve" value="保存">
                    <input class="shop_common_setup_cancel" type="button" name="shop_common_setup_cancel" value="取消">
                </div>
            </form>
        @endif
	</div>

	<!--商家合伙人地推-->
    <div class="details1" hidden="hidden">
        <p style="overflow: hidden;margin: 10px 0;">
            <span style="float: left;">商家合伙人地推设置</span>
            <span class="shop_partner_salesman_edit">编辑</span>
        </p>

        @if(!empty($shoppartnersalesman))
            <ul class="shop_partner_setup_details">
                <li>
                    <span class="front">结算周期：</span>
                    <span class="contant">每{{$shoppartnersalesman['accountperiod']}}个月结算</span>
                </li>
                <li>
                    <span class="front">有效地推定义：</span>
                    <span class="contant">{{$shoppartnersalesman['showvalidsalesman']}}</span>
                </li>

                <li>
                    <div class="front">
                        <span>地推合伙人结算：</span>
                        <span style="margin-top: 10px;color: #808080;">(缴纳1万元的地推商家，需由平台开通地推合伙人)</span>
                    </div>
                    <span class="contant">{{$shoppartnersalesman['showaccountmethod']}}</span>
                </li>
                <li class="salesman_history">
                    <a href="/console/salesman/setup/history">历史设置记录>></a>
                </li>
            </ul>
            <form action="" method="" id="shop_partner_setup" hidden>
                <ul class="setup_outer">
                    <input type="hidden" name="cityid" value="{{$cityid}}" />
                    <input type="hidden" name="salesmantype" value="shopsalesman" />
                    <input type="hidden" name="shoptype" value="partner" />
                    <li class="setup_outerli">
                        <span class="front">结算周期：</span>
                        <ul>
                            <li>
                                <input type="radio" name="" value="" checked>
                                <span>每</span>
                                <input type="text" name="accountperiod" value="{{$shoppartnersalesman['accountperiod']}}">
                                <span>个月结算</span>
                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <span class="front">有效地推定义：</span>
                        <ul>
                            <li>
                                @if($shoppartnersalesman['validsalesmanruletype'] == 1)
                                    <input type="radio" name="validsalesmanruletype" value="1" checked>
                                @else
                                    <input type="radio" name="validsalesmanruletype" value="1">
                                @endif
                                <span>与商家同城的新用户下载翻贝网App，首次登录时扫描二维码，获取邀请码完成登录即可。首次登录时未获取邀请码，可在2小时内用扫一扫功能扫二维码进入买单页面即可。</span>
                            </li>
                            <li hidden>
                                @if($shoppartnersalesman['validsalesmanruletype'] == 2)
                                    <input type="radio" name="validsalesmanruletype" value="2" checked>
                                    <span>新用户登录app且消费</span>
                                    <input type="text" name="validorderminnum" value="{{$shoppartnersalesman['validorderminnum']}}">
                                    <span>笔，单笔消费金额需达</span>
                                    <input type="text" name="validorderminamount" value="{{$shoppartnersalesman['validorderminamount']}}">
                                    <span>以上</span>
                                @else
                                    <input type="radio" name="validsalesmanruletype" value="2">
                                    <span>新用户登录app且消费</span>
                                    <input type="text" name="validorderminnum" value="0">
                                    <span>笔，单笔消费金额需达</span>
                                    <input type="text" name="validorderminamount" value="0">
                                    <span>以上</span>
                                @endif

                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <div class="front">
                            <span>地推合伙人结算：</span>
                            <span style="margin-top: 10px;color: #808080;">(缴纳1万元的地推商家，需由平台开通地推合伙人)</span>
                        </div>
                        <ul>
                            <li>
                                @if($shoppartnersalesman['accounttype'] == 1)
                                    <input type="radio" name="accounttype" value="1" checked>
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney1" value="{{$shoppartnersalesman['registergetmoney']}}">
                                    <span>元</span>
                                @else
                                    <input type="radio" name="accounttype" value="1">
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney1" value="0">
                                    <span>元</span>
                                @endif
                            </li>
                            <li>
                                @if($shoppartnersalesman['accounttype'] == 2)
                                    <input type="radio" name="accounttype" value="2" checked>
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney2" value="{{$shoppartnersalesman['registergetmoney']}}">
                                    <span>元，且该用户的每笔消费实付金额满</span>
                                    <input type="text" name="accountorderminamount" value="{{$shoppartnersalesman['accountorderminamount']}}">
                                    <span>以上的订单按</span>
                                    <input type="text" name="ordergetmoney" value="{{$shoppartnersalesman['ordergetmoney']}}">
                                    <span>元／单计为地推订单收入</span>
                                @else
                                    <input type="radio" name="accounttype" value="2">
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney2" value="0">
                                    <span>元，且该用户的每笔消费实付金额满</span>
                                    <input type="text" name="accountorderminamount" value="0">
                                    <span>以上的订单按</span>
                                    <input type="text" name="ordergetmoney" value="0">
                                    <span>元／单计为地推订单收入</span>
                                @endif
                            </li>
                            <li>
                                @if($shoppartnersalesman['accounttype'] == 3)
                                    <input type="radio" name="accounttype" value="3" checked>
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney3" value="{{$shoppartnersalesman['registergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="ordergetratio" value="{{$shoppartnersalesman['ordergetratio']}}">
                                    <span>%计为地推订单收入。</span>
                                @else
                                    <input type="radio" name="accounttype" value="3">
                                    <span>每个有效地推的注册用户</span>
                                    <input type="text" name="registergetmoney3" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="ordergetratio" value="0">
                                    <span>%计为地推订单收入。</span>
                                @endif
                            </li>
                            <li>
                                @if($shoppartnersalesman['accounttype'] == 4)
                                    <input type="radio" name="accounttype" value="4" checked>
                                    <span>前</span>
                                    <input type="text" name="topnum" value="{{$shoppartnersalesman['topnum']}}">
                                    <span>名有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="topregistergetmoney" value="{{$shoppartnersalesman['topregistergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="topordergetratio" value="{{$shoppartnersalesman['topordergetratio']}}">
                                    <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="afterregistergetmoney" value="{{$shoppartnersalesman['afterregistergetmoney']}}">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="afterordergetratio" value="{{$shoppartnersalesman['afterordergetratio']}}">
                                    <span>%计为地推订单收入。</span>
                                @else
                                    <input type="radio" name="accounttype" value="4">
                                    <span>前</span>
                                    <input type="text" name="topnum" value="0">
                                    <span>名有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="topregistergetmoney" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="topordergetratio" value="0">
                                    <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                    <input type="text" name="afterregistergetmoney" value="0">
                                    <span>元，且该用户的每笔消费按实付金额的</span>
                                    <input type="text" name="afterordergetratio" value="0">
                                    <span>%计为地推订单收入。</span>
                                @endif
                            </li>
                        </ul>
                    </li>
                </ul>
                <div class="button">
                    <input class="shop_partner_setup_preserve" type="button" name="shop_partner_setup_preserve" value="保存">
                    <input class="shop_partner_setup_cancel" type="button" name="shop_partner_setup_cancel" value="取消">
                </div>
            </form>
        @else
            <form action="" method="" id="shop_partner_setup" hidden>
                <ul class="setup_outer">
                    <input type="hidden" name="cityid" value="{{$cityid}}" />
                    <input type="hidden" name="salesmantype" value="shopsalesman" />
                    <input type="hidden" name="shoptype" value="partner" />
                    <li class="setup_outerli">
                        <span class="front">结算周期：</span>
                        <ul>
                            <li>
                                <input type="radio" name="" value="" checked>
                                <span>每</span>
                                <input type="text" name="accountperiod" value="0">
                                <span>个月结算</span>
                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <span class="front">有效地推定义：</span>
                        <ul>
                            <li>
                                <input type="radio" name="validsalesmanruletype" value="1">
                                <span>与商家同城的新用户下载翻贝网App，首次登录时扫描二维码，获取邀请码完成登录即可。首次登录时未获取邀请码，可在2小时内用扫一扫功能扫二维码进入买单页面即可。</span>
                            </li>
                            <li hidden>
                                <input type="radio" name="validsalesmanruletype" value="2">
                                <span>新用户登录app且消费</span>
                                <input type="text" name="validorderminnum" value="0">
                                <span>笔，单笔消费金额需达</span>
                                <input type="text" name="validorderminamount" value="0">
                                <span>以上</span>
                            </li>
                        </ul>
                    </li>
                    <li class="setup_outerli">
                        <div class="front">
                            <span>地推合伙人结算：</span>
                            <span style="margin-top: 10px;color: #808080;">(缴纳1万元的地推商家，需由平台开通地推合伙人)</span>
                        </div>
                        <ul>
                            <li>
                                <input type="radio" name="accounttype" value="1">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney1" value="0">
                                <span>元</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="2">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney2" value="0">
                                <span>元，且该用户的每笔消费实付金额满</span>
                                <input type="text" name="accountorderminamount" value="0">
                                <span>以上的订单按</span>
                                <input type="text" name="ordergetmoney" value="0">
                                <span>元／单计为地推订单收入</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="3">
                                <span>每个有效地推的注册用户</span>
                                <input type="text" name="registergetmoney3" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="ordergetratio" value="0">
                                <span>%计为地推订单收入。</span>
                            </li>
                            <li>
                                <input type="radio" name="accounttype" value="4">
                                <span>前</span>
                                <input type="text" name="topnum" value="0">
                                <span>名有效地推用户：每个有效地推的注册用户</span>
                                <input type="text" name="topregistergetmoney" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="topordergetratio" value="0">
                                <span>%计为地推订单收入；之后的有效地推用户：每个有效地推的注册用户</span>
                                <input type="text" name="afterregistergetmoney" value="0">
                                <span>元，且该用户的每笔消费按实付金额的</span>
                                <input type="text" name="afterordergetratio" value="0">
                                <span>%计为地推订单收入。</span>

                            </li>
                        </ul>
                    </li>
                </ul>
                <div class="button">
                    <input class="shop_partner_setup_preserve" type="button" name="shop_partner_setup_preserve" value="保存">
                    <input class="shop_partner_setup_cancel" type="button" name="shop_partner_setup_cancel" value="取消">
                </div>
            </form>
        @endif
    </div>

</section>
@endsection

@section('scriptResources')
    @parent
    <script>
    	$(".shop_common_salesman_edit").click(function(){
    		$(".shop_common_setup_details").hide();
    		$(".shop_common_salesman_edit").hide();
    		$('#shop_common_setup').show();
    	})
    	$(".shop_partner_salesman_edit").click(function(){
            $(".shop_partner_setup_details").hide();
            $(".shop_partner_salesman_edit").hide();
            $('#shop_partner_setup').show();
        })
    	$(".shop_common_setup_cancel").click(function(){
    		$(".shop_common_setup_details").show();
    		$(".shop_common_salesman_edit").show();
    		$('#shop_common_setup').hide();
    	})
    	$(".shop_partner_setup_cancel").click(function(){
            $(".shop_partner_setup_details").show();
            $(".shop_partner_salesman_edit").show();
            $('#shop_partner_setup').hide();
        })
    	$("input[name='shop_common_setup_preserve']").click(function(){
    		$.ajax({
                url:'/console/salesmanset/update',
                type:'post',
                data:$("#shop_common_setup").serialize(),
                dataType: 'json',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.reload();
                    } else {
                        alert(data.message);return;
                    }
                }
            })
    	})
    	$("input[name='shop_partner_setup_preserve']").click(function(){
            $.ajax({
                url:'/console/salesmanset/update',
                type:'post',
                data:$("#shop_partner_setup").serialize(),
                dataType: 'json',
                success:function(data){
                    if(data.status == 'success') {
                        alert(data.message);
                        window.location.reload();
                    } else {
                        alert(data.message);return;
                    }
                }
            })
        })
    </script>
@endsection